

using System;
using System.Collections.Generic;
using System.Text;
using EntityLayer;
using System.Data;
using DataAccessLayer;

namespace DataLayer
{
	public class datFilesContents
	{
		public datFilesContents()
		{
		}
		
		#region  Code Factory Generated Methods
        public void DeleteFilesContentsByFilesContentId(entFilesContents parEntFilesContents, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pFilesContentId", parEntFilesContents.FilesContentId);
            parDbConnector.ExecuteNonQuery("DeleteFilesContentsByFilesContentId", insDbParamCollection);
        }
        public void InsertFilesContents(entFilesContents parEntFilesContents, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pFileId", parEntFilesContents.FileId);
            insDbParamCollection.Add("@pLanguageId", parEntFilesContents.LanguageId);
            insDbParamCollection.Add("@pFileName", parEntFilesContents.FileName);
            insDbParamCollection.Add("@pFilePath", parEntFilesContents.FilePath);
            insDbParamCollection.AddOutput("@pFilesContentId", DbType.Int32);
            parDbConnector.ExecuteNonQuery("InsertFilesContents", insDbParamCollection);
            parEntFilesContents.FilesContentId = Convert.ToInt32(insDbParamCollection.GetOutPutParameter().Value);
        }
        public void UpdateFilesContentsByFilesContentId(entFilesContents parEntFilesContents, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pFilesContentId", parEntFilesContents.FilesContentId);

            insDbParamCollection.Add("@pFileId", parEntFilesContents.FileId);
            insDbParamCollection.Add("@pLanguageId", parEntFilesContents.LanguageId);
            insDbParamCollection.Add("@pFileName", parEntFilesContents.FileName);
            insDbParamCollection.Add("@pFilePath", parEntFilesContents.FilePath);
            parDbConnector.ExecuteNonQuery("UpdateFilesContentsByFilesContentId", insDbParamCollection);
        }
       

		#endregion
        public DataTable SelectFilesContentsByFileId(entFilesContents parEntFilesContents, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pFileId", parEntFilesContents.FileId);
            return parDbConnector.ExecuteDataTable("SelectFilesContentsByFileId", insDbParamCollection);
        }
        public void DeleteFilesContentsByFileId(entFilesContents parEntFilesContents, DbConnector parDbConnector)
        {
            DbParamCollection insDbParamCollection = new DbParamCollection();
            insDbParamCollection.Add("@pFileId", parEntFilesContents.FileId);
            parDbConnector.ExecuteNonQuery("DeleteFilesContentsByFileId", insDbParamCollection);
        }
	}
}